<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
//用户认证接口的路由
Route::group(['prefix' => 'Auth','namespace'=>'Api\\Auth','middleware' => ['auth:api','checkpermission']], function(){
    Route::get('User/get', 'UserController@get')->name('api.auth.user.get');
});

//安全认证的接口路由
Route::group(['prefix' => 'Safe','namespace'=>'Api\\Safe','middleware' => ['client']], function(){

});

//小程序接口路由
Route::group(['prefix' => 'Applet', 'namespace' => 'Api\\Applet', 'middleware' => ['checkapi.wx_mini_program']], function () {
    //微信基本接口路由
    Route::any('UserBase/getToken', 'UserBaseController@getToken')->name('api.applet.userbase.gettoken');
    Route::post('UserBase/decrypt', 'UserBaseController@decrypt')->name('api.applet.userbase.decrypt');
    Route::post('UserBase/getUserInfo', 'UserBaseController@getUserInfo')->name('api.applet.userbase.getuserinfo');
    Route::post('UserBase/decryptUserInfo', 'UserBaseController@decryptUserInfo')->name('api.applet.userbase.decryptuserinfo');
    Route::post('UserBase/decryptUserPhone', 'UserBaseController@decryptUserPhone')->name('api.applet.userbase.decryptuserphone');


});
